package com.example.shoppingmall.service;

import com.example.shoppingmall.pojo.Evaluate;
import com.example.shoppingmall.dao.EvaluateMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EvaluateService {
    @Autowired
    private EvaluateMapper evaluateMapper;

    public List<Evaluate> evaluateList(@Param("userPhone")String userPhone,
                                       @Param("orderno")String orderno,
                                       @Param("no")int no){
        return evaluateMapper.evaluateList(userPhone,orderno,no);
    }

    public int count(@Param("userPhone")String userPhone,
                     @Param("orderno")String orderno){
        return evaluateMapper.count(userPhone,orderno);
    }

    public Evaluate xiangQing(@Param("orderno")String orderno){
        return evaluateMapper.xiangQing(orderno);
    }

    public int update(@Param("id")int id){
        return evaluateMapper.update(id);
    }

    public int delete(@Param("id")int id){
        return evaluateMapper.delete(id);
    }

    public List<Evaluate>listForCommodityId(@Param("commodityId")int commodityId,@Param("no")int no){
        return evaluateMapper.listForCommodityId(commodityId,no);
    }

    public int countForCommodityId(@Param("commodityId")int commodityId){
        return evaluateMapper.countForCommodityId(commodityId);
    }

}
